- page_title _('GPG keys')
- add_page_specific_style 'page_bundles/profile'
- @force_desktop_expanded_sidebar = true
- hide_class = 'gl-hidden' if form_errors(@gpg_key)

= render ::Layouts::SettingsSectionComponent.new(page_title) do |c|
  - c.with_description do
    = _('GPG keys allow you to verify signed commits.')

  - c.with_body do
    = render ::Layouts::CrudComponent.new(_('Your GPG keys'),
      icon: 'key',
      count: @gpg_keys.count,
      toggle_text: _('Add new key'),
      toggle_options: { class: hide_class },
      form_options: { form_errors: form_errors(@gpg_key) }) do |c|
      - c.with_form do
        %h4.gl-mt-0
          = _('Add a GPG key')
        %p
          - help_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_page_path('user/project/repository/signed_commits/gpg.md') }
          = _('Add a GPG key for secure access to GitLab. %{help_link_start}Learn more%{help_link_end}.').html_safe % {help_link_start: help_link_start, help_link_end: '</a>'.html_safe }
        = render 'form'

      - c.with_body do
        = render 'key_table', hide_class: hide_class
